package com.yufubao.api.controller.applet.elasticsearch;

import com.yufubao.framework.annotation.SystemLog;
import com.yufubao.framework.result.ResponseResult;
import com.yufubao.model.dto.applet.search.SearchParam;
import com.yufubao.model.vo.applet.search.SearchResult;
import com.yufubao.service.service.applet.elasticsearch.AppletSearchService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 张一恒
 * @version 1.0
 * @description: 小程序检索
 * @date 2024/9/3 17:22
 */
@RestController
@RequestMapping("/applet/search")
public class SearchController {

    @Autowired
    private AppletSearchService appletSearchService;


    /**
     * 小程序es检索商户信息
     */
    @RequestMapping(value = "/listPage", method = RequestMethod.POST)
    //@RequiresPermissions("gulimallcoupon:skufullreduction:list")
    @SystemLog(info = "小程序es检索商户信息")
    @ApiOperation(value = "小程序es检索商户信息")
    public ResponseResult listPage(@RequestBody SearchParam searchParam) {
        SearchResult result = appletSearchService.listPage(searchParam);
        return ResponseResult.okResult(result);
    }


}
